/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//聊天发送
$(function(){
  $(document).keyup(function(event){
    if(event.keyCode ==13){
        var text = $('#push-chart').val();
        if(IsVain(text) == true){
            alert('不可以发送空消息');
            return;
        }
        var data = text;
        $.post("http://localhost:8811/index.php?s=index/chart/push",{data:data},function(res){
            console.log(res);
        },'json');
    }
  });
});

function IsVain(s)
{
    if($.trim(s)==''){
        return true;
    }else{
        return false;
    }
}


